﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HA.Data
{
    [Serializable]
    public class DOGrid3d:ICloneable 
    {

        public DOGrid3d()
        {
            //this._contourOption = new DOContourOption();

            this._contour = new DOContourOptionV2();
 
        }


        //[field: NonSerialized]
        //public event EventHandler IsShowContourChanged;


        //[field: NonSerialized]
        //public event EventHandler IsShowVectorChanged;





        private bool _isShowContour=true;


        /// <summary>
        /// 是否显示等值线
        /// </summary>
        public bool IsShowContour
        {
            get { return _isShowContour; }
            set { _isShowContour = value; }
        }


        bool _isShowVector = true ;

        /// <summary>
        /// 是否显示向量线
        /// </summary>
        public bool IsShowVector
        {
            get { return _isShowVector; }
            set { _isShowVector = value; }
        }



        //private ContourType contourType = ContourType.LayerContour ;
        ///// <summary>
        ///// 标记是否选择Contour 及类型（GridContour还是LayerContour）
        ///// </summary>
        //public ContourType ContourType
        //{
        //    get { return contourType; }
        //    //set { chooseContour = value; }
        //}


     


        //新的等值线选项部分

        DOContourOptionV2 _contour;

        public DOContourOptionV2 Contour
        {
            get { return _contour; }
         
        }

        /// <summary>
        /// 得到修改后的。。。
        /// </summary>
        /// <param name="contour"></param>
        public void GetContourOpton( DOContourOptionV2 contour)
        {
            this._contour = contour;
        }



        DOVector _vector = new DOVector();


        /// <summary>
        /// 向量相关的显示选项
        /// </summary>
        public  DOVector Vector
        {
            get { return _vector; }
            set { _vector = value; }
        }




        public List<string> ResetDOGrid3d(DOGrid3d grid)
        {
            List<string> props = new List<string>();
           

            ///等值线的详细设置改变，不通过字段传递


            //this._contour.ReSetContourOption(grid._contour);

            //this._vector.ResetVecorOption(grid._vector);


            if (this._isShowContour!=grid.IsShowContour)
            {
                props.Add("IsShowContour");
                
            }

            if (this._isShowVector!=grid.IsShowVector)
            {
                props.Add("IsShowVector");
                
            }

            return props ;
 
        }









        #region ICloneable 成员

        public object Clone()
        {

            DOGrid3d obj = (DOGrid3d)this.MemberwiseClone();

            obj._contour = (DOContourOptionV2)this._contour.Clone();

            obj._vector = (DOVector)this._vector.Clone();


            return obj;


            //throw new NotImplementedException();
        }

        #endregion
    }

}
